// function checkAge (min, age) {
//   return age >= min;
// }

// 柯里化
function checkAge (min) {
  return function (age) {
    return age >= min;
  }
}

// ES6写法
var checkAge = min => (age => age >= min);

let checkAge18 = checkAge(18);
let checkAge20 = checkAge(20);

console.log(checkAge18(20));
console.log(checkAge20(19));